<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看详情</title>
</head>
<body>
<input type="button" value="封禁响应博客和其账号" onclick="ban_click()">
<div>
    <br>
</div>
<div id="report">
    <img id="pic" src="" height="200" alt="图片在此显示，无法显示表示举报并未附加截图">
</div>
</body>
</html>

<script src="../js/ajax.js"></script>
<script src="../js/vue.js"></script>

<script>
    let query = window.location.search.substring(1);
    let report_id = query.split("=");
    window.localStorage.setItem("reportId",report_id[1]);
    window.onload= function getPic() {
        ajax({
            method: "post",
            url: "../../report",
            data: {
                reportId: report_id[1],
                code: 2,
            },
            success: function (result) {
                console.log(result);
                let obj = document.getElementById("pic");
                obj.src = result['picurl'].replace("]","");
            },
            error: function () {
                alert("数据读取失败");
            }
        })
    }

    function ban_click(){
        ajax({
            method: "post",
            url: "../../report",
            data: {
                reportId: report_id[1],
                code: 3,
            },
            success: function (result) {
                console.log(result);
            },
            error: function () {
                alert("数据读取失败");
            }
        })
    }
</script>